package myfamily.model;

public class Contact {

   private String phone;
   private String email;

   public Contact() {
   }

   public Contact(String phone, String email) {
       this.phone = phone;
       this.email = email;
   }

   public String getPhone() {
       return phone;
   }

   public void setPhone(String phone) {
       DatabaseObject db = DatabaseObjectFactory.getDatabaseObject();
       db.pm.currentTransaction().begin();
       this.phone = phone;
       db.pm.currentTransaction().commit();
   }

   public String getEmail() {
       return email;
   }

   public void setEmail(String email) {
       DatabaseObject db = DatabaseObjectFactory.getDatabaseObject();
       db.pm.currentTransaction().begin();
       this.email = email;
       db.pm.currentTransaction().commit();
   }

       public String toString() {
       return email + " " + phone;
   }
}